package com.haolp.sys.controller;

import com.haolp.sys.common.vo.JsonResultVO;
import com.haolp.sys.common.vo.PageObjectVO;
import com.haolp.sys.pojo.SysLog;
import com.haolp.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小李
 * @version 1.0
 * @date 2021/10/6 9:24
 */
@Controller
//+@ResponseBody
//@RestController
@RequestMapping("/log/")
public class SysLogController {
    @Autowired
   private SysLogService sysLogService;
    @RequestMapping("doDeleteObjects")
    @ResponseBody
    public JsonResultVO doDeleteObjects(Integer...ids){
        sysLogService.deleteObjects(ids);
        return new JsonResultVO("delete ok");
    }
    @RequestMapping("doFindPageObjects")
    @ResponseBody
    public JsonResultVO doFindPageObjects(
            String username,Integer pageCurrent){
        PageObjectVO<SysLog> pageObjects = sysLogService.findPageObjects
                (username, pageCurrent);
        return new JsonResultVO(pageObjects);
    }
    @RequestMapping("doLogListUI")
//    @ResponseBody
    public String doLogListUI(){
        return "sys/log_list";
    }
}
